// 绘制直线
import BaseElement from './element';
import { getObjProperty } from '../utils';
class Circle extends BaseElement {
    constructor(opts) {
        super(opts);
        const { action = {} } = opts;
        this.fill = getObjProperty(action, 'fill', true);
    }

    draw(ctx, path = false) {
        this.beforDraw(ctx, path);
        let { x, y, r, startAngle, endAngle, anticlockwise } = this.points[0];
        let s = startAngle || 0;
        let e = endAngle || Math.PI * 2;
        let a = anticlockwise || false;
        ctx.arc(x, y + this.offset, r, s, e, a);
        this.afterDraw(ctx, path);
    }
    isPointIn(ctx, x, y) {
        if (this.closePath) {
            return ctx.isPointInPath(x, y);
        } else {
            return ctx.isPointInStroke(x, y);
        }
    }
    addPoint() {}
    update() {}
}
export default Circle;
